log using SDOrealismSubmission.log, replace
set more off

* File: SDOrealismSubmission.do
* Date: 7 February 201
* Run: final tables 
* David Rousseau, University at Albany (drousseau@albany.edu)
* Paper:�Social Dominance Orientation and Realism in the Context of International Politics: Beliefs and Foreign Policy Opinions.�

* program: Stata 14.0 on a mac
*
set matsize 400
*
use SDOrealismSubmissionData.dta
*************************************************
* Tables for final version
* Table 1: Key assumptions of realisma and liberalism: no analysis
* Table 2: Realist-Idealist survey questions: no analysis 
* Table 3: SDO survey questions: no analysis 
* Table 4: SDO International Version: no analysis
* Table 5: Policy questions: no analysis 

* Table 6 summary statistics
summarize ideareal SDO p1D p2Ddiss p3D p4D p5D gender over35 conservative collegegrad richer
summarize SDO if SDOversion==1
summarize SDO if SDOversion==2

* Figure 1
twoway scatter ideareal SDO if SDOversion==1, ylabel(-20(10)20) xlabel(-50(25)50)
twoway scatter ideareal SDO if SDOversion==2, ylabel(-20(10)20) xlabel(-50(25)50)

* Table 7
ttest v1, by(SDOversion) unequal
ttest v2, by(SDOversion) unequal
ttest v3, by(SDOversion) unequal
ttest v4, by(SDOversion) unequal
ttest v5, by(SDOversion) unequal
ttest v6, by(SDOversion) unequal
ttest v7, by(SDOversion) unequal
ttest v8, by(SDOversion) unequal
ttest v9, by(SDOversion) unequal
ttest v10, by(SDOversion) unequal
ttest v11, by(SDOversion) unequal
ttest v12, by(SDOversion) unequal
ttest v13, by(SDOversion) unequal
ttest v14, by(SDOversion) unequal
ttest v15, by(SDOversion) unequal
ttest v16, by(SDOversion) unequal

* Table 8
regress SDO gender over35 conservative collegegrad richer, robust 
outreg2 using Table8, replace label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(F r2 rmse)
regress SDO gender over35 conservative collegegrad richer if SDOversion==1, robust 
outreg2 using Table8, append label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(F r2 rmse)
regress SDO gender over35 conservative collegegrad richer if SDOversion==2, robust 
outreg2 using Table8, append label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(F r2 rmse)

* Table 9
probit p1D ideareal SDO gender over35 conservative collegegrad richer, robust
margins, dydx(*)
outreg2 using Table9, replace label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(ll chi2 p r2_p)
probit p2Ddiss ideareal SDO gender over35 conservative collegegrad richer, robust
margins, dydx(*)
outreg2 using Table9, append label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(ll chi2 p r2_p)
probit p3D ideareal SDO gender over35 conservative collegegrad richer, robust
margins, dydx(*)
outreg2 using Table9, append label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(ll chi2 p r2_p)
probit p4D ideareal SDO gender over35 conservative collegegrad richer, robust
margins, dydx(*)
outreg2 using Table9, append label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(ll chi2 p r2_p)
probit p5D ideareal SDO gender over35 conservative collegegrad richer, robust
margins, dydx(*)
outreg2 using Table9, append label alpha(0.001, 0.01, 0.05) excel bdec(3) sdec(3) e(ll chi2 p r2_p)

*************************************************
* end of file
log close
exit

